<?php

class Quad_Date_Calendar_Day {
	
	public $raw;
	public $contextType;
	public $calendarMonth;

	public function __construct(Quad_Date_Calendar_Month $calendarMonth, $date, $contextType = 0) {
		$this->calendarMonth = $calendarMonth;
		$this->raw = Quad_Date::create($date);
		$this->contextType = $contextType;
	}
	
	public function __get($p) {
		switch ($p) {
			case 'year':
				return $this->raw->format('Y');
			case 'month':
				return $this->raw->format('n');
			case 'day':
				return $this->raw->format('j');
		}
		return null;
	}
	
	public function format($code) {
		return $this->raw->format($code);
	}
	
}